<?php

/*
class View, class for operating with a template
Copyright (C) 2011  Petr Čermák

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

require_once 'Component.php';

abstract class View extends Component{

    public function initialize(){}
    public function processRequest(){$this->render();}

    public abstract function getData();
    public abstract function setData($data);
    public abstract function addData($data);
    public abstract function setValue($name, $value);
    public abstract function getValue($name);
    public abstract function hasValue($name);
    public abstract function deleteValue($name);
    public abstract function render();

    public function createOutput(){
        ob_start();
        $this->render();
        $output = ob_get_contents();
        ob_end_clean();
        return $output;
    }

}
?>
